package com.xinqi.modules.course.classroom.controller.web;

import com.xinqi.common.base.response.R;
import com.xinqi.modules.course.classroom.service.LiveActService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 课堂互动web
 *
 * @author liuxingxing
 * @since 2023-03-31 14:16:54
 */

@RestController
@RequestMapping("/web/classroominteraction")
@RequiredArgsConstructor
public class ClassRoomWebController {
    /**
     * 服务对象
     */
    private final LiveActService liveActService;

    /**
     * 统计：互动课件，资料，互动视频，公告等等未读数
     *
     * @return
     */
    @PostMapping("/count/unread/{classId}")
    public R<Map<String, Object>> countUnread(@PathVariable("classId") Long classId) {
        Map<String, Object> res = this.liveActService.countUnread(classId);
        return R.ok(res);
    }
}
